﻿
using Enferno.StormApiClient.Expose;

namespace Enferno.Public.Web.Components.Server
{
    public interface IPaymentDetails
    {
        NameValues GetPaymentParameters(int paymentMethodId);
    }

    public class DefaultPaymentDetails : IPaymentDetails
    {
        public NameValues GetPaymentParameters(int paymentMethodId)
        {
            const int klarnaInvoice = 10;
            const int cardPayment = 12;

            switch (paymentMethodId)
            {
                case klarnaInvoice:
                    return new NameValues();
                case cardPayment:
                    return new NameValues
                    {
                        new NameValue {Name = "CancelUrl", Value = "/Checkout"},
                        new NameValue {Name = "ReturnUrl", Value = "/"}
                    };
                default:
                    return new NameValues();
            }
        }
    }
}
